package training;

import java.util.HashMap;
import java.util.Scanner;

public class Day1_02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        HashMap<Character, Integer> hashMap = new HashMap<>();
        for (int i = 0; i < s2.length(); i++) {
            if(!hashMap.containsKey(s2.charAt(i))){
                hashMap.put(s2.charAt(i),1);
            }
        }
        String s = "";
        for (int i = 0; i < s1.length(); i++) {
            if(!hashMap.containsKey(s1.charAt(i))){
                s += s1.charAt(i);
            }
        }
        System.out.println(s);
    }
}
